package six

import org.apache.spark.{SparkConf, SparkContext}

object FlatMapTestScala {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setAppName("TestTransformation").setMaster("local")
    val sc = new SparkContext(conf)

    val list = List("张无忌 赵敏", "宋青书 周芷若")
    val listRdd = sc.parallelize(list)

    val nameRdd = listRdd.flatMap(line => line.split(" ")).map(name => "Hello " + name)
    nameRdd.foreach(name => println(name))
  }
}
